

function checkUsername() {
	var username = $("username").value;
	DwrDemoService.checkUsername(username, function(data) {
		            var msg = "";
					if (data) {
						msg = " is exsites,Please choose other username!"
						$("checkmsg").style.color = "red";
					} else {
						msg =  " is available";
						$("checkmsg").style.color = "green";
					}
					$("checkmsg").innerHTML = username + msg;
			});
}

function doSubmit() {
	if ($("username").value == "") {
		alert("用户名不能为空!");
		return false;
	} else if ($("password").value == "") {
		alert("密码不能为空!");
		return false;
	} else if ($("password").value != $("repassword").value) {
		alert("两次输入的密码不一致!");
		return false;
	}
	$("registerForm").submit();
}

function $(id) {
	return document.getElementById(id);
}